<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>定位元素</title>
</head>
<body>
  <fieldset>
    <legend>Which color do you prefer?</legend>
    <ul>
      <li>
        <input type="radio" value="red" name="color" id="colorRed">
        <label for="colorRed">Red</label>
      </li>
      <li>
        <input type="radio" value="green" name="color" id="colorGreen">
        <label for="colorGreen">Green</label>
      </li>
      <li>
        <input type="radio" value="blue" name="color" id="colorBlue">
        <label for="colorBlue">Blue</label>
      </li>
    </ul>
  </fieldset>
  <script>
    const radios = document.getElementsByName('color');
    console.log(radios);
  </script>
</body>
</html>